package com.zjut.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zjut.domain.FinalQuestions;
import com.zjut.domain.Paper;
import com.zjut.domain.Questions;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface QuestionsServiceImpl {
    /**
     * 保存
     *
     * @param questions
     * @return
     */
    boolean save(Questions questions);

    /**
     * 修改
     *
     * @param questions
     * @return
     */
    boolean update(Questions questions);

    /**
     * 按id删除
     *
     * @param id
     * @return
     */
    boolean delete(Integer id);

    /**
     * 按id查询
     *
     * @param id
     * @return
     */
    Questions getById(Integer id);

    /**
     * 查询全部
     *
     * @return
     */
    List<Questions> getAll();

    /**
     * 分页查询
     *
     * @return
     */
    IPage<Questions> getPage(Integer currentPage, Integer pageSize, Questions questions);

    /**
     * 分页查询
     *
     * @return
     */
    IPage<Questions> getPage(Integer currentPage, Integer pageSize, Questions questions, Double difficultyMin, Double difficultyMax);

    // 初步筛选
    public List<FinalQuestions> selectQuestions(String type, Paper paper);

    List<Questions> selectByIds(List<Integer> idList);
}
